<?php
include 'header.php';
?>
<div style="margin-left:20px">
<h2>Cart</h2>
</div>
<?php
if($produk->num_rows > 0){
		foreach($produk->result() as $rows){
	  ?>
<div class="panel panel-primary" style="margin-right:10px">
  <!-- Default panel contents -->
  <div class="panel-heading">
  </div>
  <div class="panel-body">

   <div class="hero-unit">
		<div class="media">
			<a class="pull-left" href="#">
				<img class="media-object" src="<?php echo base_url().$rows->gambar; ?> " height="50" alt="">
			</a>
			<div class="media-body">
				<h4 class="media-heading">Media heading</h4>
				<?php 
				echo $rows->ket_produk;
				?>
			</div>
		</div>
		<p>Harga: <?php echo $rows->harga; ?></p>
		<p>Stok: <?php echo $rows->jml_produk; ?></p>
<form action="<?php echo base_url().'index.php/cart/cekout/'.$rows->id_cart?>" method="post">
		<div>
			<label>Quantity </label> 
			<input type="text" name='qty[]' value="1"> 
			<input type="text" name='id[]' value="<?php echo $rows->id_produk ?>" style="display:none">
			<input type="text" name='id_item[]' value="<?php echo $rows->id_item ?>" style="display:none">
		</div>
		<a class="btn btn-primary btn-large" href= "<?php echo base_url().'index.php/cart/hapus_cart/'.$rows->id_item; ?>">Hapus dari cart</a>
   </div>
</div>

</div>

<?php
} 
?>
<a class="btn btn-primary btn-large" href= "<?php echo base_url().'index.php/produk/' ?>">Kembali ke daftar produk</a>
<input type="submit" class="btn btn-primary btn-large" value='Checkout'>
</form>
<?php
}else{
?>
	<div class="alert alert-danger">
		<a href="#" class="alert-link">Anda tidak memiliki produk pada cart! </a>
	</div>
	<a class="btn btn-primary btn-large" href= "<?php echo base_url().'index.php/produk/' ?>">Kembali ke daftar produk</a>
<?php
}
?>